# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=kmailtransport
pkgver=24.02.2
pkgrel=0
pkgdesc="Manage mail transport"
# armhf blocked by extra-cmake-modules
# ppc64le, s390x and armv7 blocked by libkgapi
arch="all !armhf !ppc64le !s390x !riscv64 !armv7"
url="https://kontact.kde.org/"
license="LGPL-2.0-or-later"
depends_dev="
	akonadi-dev
	akonadi-mime-dev
	kcmutils-dev
	kconfigwidgets-dev
	ki18n-dev
	kio-dev
	kmime-dev
	ksmtp-dev
	kwallet-dev
	libkgapi-dev
	qtkeychain-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="
	dbus
	xvfb-run
	"
subpackages="$pkgname-dev $pkgname-lang"
_repo_url="https://invent.kde.org/pim/kmailtransport.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kmailtransport-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	# smtpjobtest is broken
	dbus-run-session -- xvfb-run ctest --test-dir build --output-on-failure -E "smtpjobtest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
705a8e5c2dca4e009b027445bef9b822b979d229e43eabb485d8fcb2ee71b6a1681c4a0355170a617cf82409286acfd8b27ba005728a20db5cd95ca9d75a13dc  kmailtransport-24.02.2.tar.xz
"
